//=============================================================================
// Scourge Gun - Drains Enyara's Mana (Health for now)
//=============================================================================
class Scourge extends Weapon
   config(user);

#EXEC OBJ LOAD FILE=InterfaceContent.utx


function float GetAIRating()
{
 local Bot B;
 local float EnemyDist;
 local vector EnemyDir;

 B = Bot(Instigator.Controller);
 if ( B == None )
  return AIRating;

 if ( B.Enemy == None )
 {
  if ( (B.Target != None) && VSize(B.Target.Location - B.Pawn.Location) > 3500 )
   return 0.2;
  return AIRating;
 }

 if ( B.Enemy.IsHumanControlled() && EnyaraPawn(B.Enemy) != none) {
   EnemyDir = B.Enemy.Location - Instigator.Location;
   EnemyDist = VSize(EnemyDir);

   if (EnemyDist > 800 || EnemyDist < 100)
      return 0.2;

   if (EnyaraPlayerController(B.Enemy.Controller).Mana > 5) {
     return 1.0;
   }

   return 0.0;
 }
/*
 // if retreating, favor this weapon
 EnemyDir = B.Enemy.Location - Instigator.Location;
 EnemyDist = VSize(EnemyDir);
 if ( EnemyDist > 1500 )
  return 0.1;
 if ( B.IsRetreating() )
  return (AIRating + 0.4);
 if ( (B.Enemy.Weapon != None) && B.Enemy.Weapon.bMeleeWeapon )
  return (AIRating + 0.35);
 if ( -1 * EnemyDir.Z > EnemyDist )
  return AIRating + 0.1;
 if ( EnemyDist > 1000 )
  return 0.35;
*/
 return AIRating;
}

/* BestMode()
choose between regular or alt-fire
*/
function byte BestMode()
{
  return 0;
}

function float SuggestAttackStyle()
{
 local Bot B;
 local float EnemyDist;

 B = Bot(Instigator.Controller);
 if ( (B == None) || (B.Enemy == None) )
  return 0.4;

 EnemyDist = VSize(B.Enemy.Location - Instigator.Location);
 //log("EnemyDist: "$EnemyDist);
 if ( EnemyDist > 1000 )
  return 1.0;
 if ( EnemyDist > 00 )
  return 0.4;


 return -0.1;
}

function float SuggestDefenseStyle()
{
 local Bot B;

 B = Bot(Instigator.Controller);
 if ( (B == None) || (B.Enemy == None) )
  return 0;

 if ( VSize(B.Enemy.Location - Instigator.Location) < 1600 )
  return -0.6;
 return 0;
}

defaultproperties
{
     FireModeClass(0)=Class'Enyara.ScourgeFire'
     FireModeClass(1)=Class'Enyara.ScourgeAltFire'
     SelectAnim="Pickup"
     PutDownAnim="PutDown"
     SelectAnimRate=0.667000
     PutDownAnimRate=1.000000
     PutDownTime=0.450000
     BringUpTime=0.675000
     SelectSound=Sound'WeaponSounds.Misc.redeemer_change'
     SelectForce="SwitchToScourge"
     AIRating=1.500000
     CurrentRating=1.500000
     bNotInDemo=True
     Description="Scourge - Zaps enemies life force"
     DemoReplacement=Class'XWeapons.RocketLauncher'
     DisplayFOV=60.000000
     Priority=9
     SmallViewOffset=(X=26.000000,Y=6.000000,Z=-34.000000)
     CustomCrosshair=13
     CustomCrossHairColor=(B=128)
     CustomCrossHairScale=2.000000
     CustomCrossHairTextureName="Crosshairs.Hud.Crosshair_Circle2"
     InventoryGroup=0
     GroupOffset=1
     PickupClass=Class'Enyara.ScourgePickup'
     PlayerViewOffset=(X=14.000000,Z=-28.000000)
     PlayerViewPivot=(Pitch=1000,Yaw=-400)
     BobDamping=1.400000
     AttachmentClass=Class'XWeapons.RedeemerAttachment'
     IconMaterial=Texture'HUDContent.Generic.HUD'
     IconCoords=(X1=4,Y1=350,X2=110,Y2=395)
     ItemName="Scourge"
     Mesh=SkeletalMesh'Weapons.Redeemer_1st'
     DrawScale=1.200000
     bCanThrow=false;

}
